#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <net/ethernet.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

typedef struct ex1
{
    unsigned short a;
}ex1;

typedef struct ex2
{
    unsigned char a:1;
    unsigned char b:1;
    unsigned char c:1;
    unsigned char d:1;
    unsigned char e:1;
    unsigned char f:1;
    unsigned char g:1;
    unsigned char h:1;
    //0001 1000
}ex2;
int main(int argc, char const *argv[])
{
    ex1 num1;
    num1.a = 65280;
    unsigned char *str1 = (char*)&num1;
    printf("str1[0]:%d,str1[1]:%d\n",str1[0],str1[1]);
    char a = 0b11110001;
    ex2 num2;
    num2.a=0;
    num2.b=1;
    num2.c=1;
    num2.d=1;
    num2.e=1;
    num2.f=1;
    num2.g=1;
    num2.h=1;
    unsigned char *str2 = (char*)&num2;
    printf("str2:%d\n",str2[0]);




    return 0;
}

